package com.zs.lib_base.ext

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.schedulers.Schedulers


/**
 * 不关心返回数据
 * Don't care back
 */
fun Observable<out Any>.dcb(): Disposable {
    return this.subscribeOnIo()
        .subscribe({}, {
            "dcb".e()
        })
}

fun <T> Observable<T>.applyMain(): Observable<T> {
    return this.observeOn(AndroidSchedulers.mainThread())
}

fun <T> Observable<T>.subscribeOnIo(): Observable<T> {
    return this.subscribeOn(Schedulers.io())
}